Pin numpy<2 in test_stable min-req job for torch <2.4#3310
Closed
saitcakmak wants to merge 2 commits into
Closed
Conversation
The min-req job pins torch to the floor declared in pyproject.toml (2.2), but lets pip resolve numpy unconstrained, which picks up numpy 2.x. Torch <2.4 was built against the numpy 1.x C ABI and fails at import time with "numpy not available" when paired with numpy 2.x. Constrain numpy<2 on the Python 3.11 leg, matching the existing pattern used to override the torch floor on the Python 3.14 leg (which uses torch 2.9 and supports numpy 2.x).
The first install pinned numpy<2 alongside torch 2.2, but the second 'uv pip install .[test]' re-resolved with no numpy cap and upgraded numpy to 2.x, re-introducing the ABI mismatch. Thread the same constraint through both install commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3310 +/- ##
=======================================
Coverage 99.98% 99.98%
=======================================
Files 226 226
Lines 22470 22470
=======================================
Hits 22466 22466
Misses 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The min-req job pins torch to the floor declared in pyproject.toml (2.2), but lets pip resolve numpy unconstrained, which picks up numpy 2.x. Torch <2.4 was built against the numpy 1.x C ABI and fails at import time with "numpy not available" when paired with numpy 2.x. Constrain numpy<2 on the Python 3.11 leg, matching the existing pattern used to override the torch floor on the Python 3.14 leg (which uses torch 2.9 and supports numpy 2.x).
Before:
https://github.com/meta-pytorch/botorch/actions/runs/26538884146/job/78174986399 fails with Numpy not available.
After:
https://github.com/meta-pytorch/botorch/actions/runs/26543116588